package com.itlong.Pojo;


import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {

    private Integer code;//响应码
    private String msg;//响应信息
    private T data;

    public static <T> Result success(T data) {
        return new Result<>(0,"操作成功",data);
    }

    public static Result success() {
        return new Result(0,"操作成功",null);
    }

    public static  Result error(String massage) {
        return new Result(1, massage, null );
    }
}
